#coding=utf-8
import wx
from blockwindow import BlockWindow
import wx.aui
wx.Log.SetLogLevel(0)
labels = "one two three four five six seven eight nine".split()
text = """\
Hello!

Welcome to this little demo of draggable tabs using the wx.aui module.

To try it out, drag a tab from the top of the window all the way to the bottom.  After releasing the mouse, the tab will dock at the hinted position.  Then try it again with the remaining tabs in various other positions.  Finally, try dragging a tab to an existing tab ctrl.  You'll soon see that very complex tab layouts may be achieved.
"""
class TestFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "GridBagSizer Test")
        self.tb  = TestTB(self,-1) 
        self.tb.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGED, self.OnPageChanged)
        print '2'

    def OnPageChanged(self, event):
    	old = event.GetOldSelection()
    	new = event.GetSelection()
    	sel = self.tb.GetSelection()
    	print 'OnPageChanged,  old:%d, new:%d, sel:%d\n' % (old, new, sel)
    	event.Skip()


class TestTB(wx.Toolbook):
	def __init__(self, parent, id):
		wx.Toolbook.__init__(self, parent,-1, size = (800, 400),)
		il = wx.ImageList(122, 58)
		b1 = wx.Image('images/fout.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap()
		b2 = wx.Image('images/fin.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap()
		b3 = wx.Image('images/infodata.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap()
		index0 = il.Add(b1)
		index1 = il.Add(b2)
		index2 = il.Add(b3)
		self.AssignImageList(il)
		win1 = wx.Panel(self, -1)
		win1.SetBackgroundColour(wx.Colour(166, 255, 166))
		self.AddPage(win1, '',imageId = index0)

		win2 = wx.Panel(self, -1)
		win2.SetBackgroundColour(wx.Colour(66, 55, 66))
		self.AddPage(win2, '',imageId = index1)

		win3 = wx.Panel(self, -1)
		win3.SetBackgroundColour(wx.Colour(88, 88, 88))
		self.AddPage(win3, '',imageId = index2)


		help(self)
		print '1'



        
app = wx.PySimpleApp()
TestFrame().Show()
app.MainLoop()